Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace ovn legacy client with libovsdb #3018

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Jul 7, 2023

What type of this PR

  • Performance

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

🤖 Generated by Copilot at 0559879

This pull request refactors the ovn client in the controller package to use the go-ovn library instead of the ovn-nbctl command, which simplifies the code and removes unnecessary dependencies and functions. It also updates the mock interfaces for testing, enhances the NAT options for floating IP addresses, and adjusts the import and initialization of the ovn client in other packages.

🤖 Generated by Copilot at 0559879

We're sailing on the OVN sea, with go-ovn as our guide
We've left behind the ovn-nbctl command, and all its troubles wide
We've refactored all our ovn clients, and made our code more neat
So heave away, me hearties, heave away, on the count of three

HOW

🤖 Generated by Copilot at 0559879

  • Refactor the ovn client to use the go-ovn library instead of the ovn-nbctl command (link, link, link, link, link, link, link)
  • Add and modify methods for the NAT and DHCPOptions interfaces in the mocks package, which are used for testing the ovn client with gomock (link, link, link, link, link, link, link, link)
  • Add a new parameter mtu to the UpdateDHCPOptions method of the ovn client, which is used to set the mtu option in the dhcp options (link, link, link, link, link)
  • Remove the import of the ovs package from the controller_health_check.go and controller.go files, as it is no longer needed by the controller package (link, link)
  • Modify the condition to check if a dhcp option should be deleted in the gcLogicalSwitch function of the controller, using the strset package to create and check a set of subnet names (link)
  • Modify the call to the DeleteDHCPOptionsByUUIDs method of the ovn client in the gcLogicalSwitch function of the controller, adding a variadic parameter to allow passing a slice of uuids as individual arguments (link)
  • Add the import of the strconv package to the ovn_fip.go file of the controller package, as it is used to convert a boolean value to a string for the nat options (link)
  • Add the import of the ovnnb package to the ovn_fip.go file of the controller package, as it is used to access the go-ovn library (link)

@zhangzujian zhangzujian added the performance Anything that can make Kube-OVN faster label Jul 7, 2023
@zhangzujian zhangzujian force-pushed the libovsdb branch 3 times, most recently from 9320d65 to 0d3f441 Compare July 8, 2023 04:11
@zhangzujian zhangzujian marked this pull request as ready for review July 10, 2023 00:05
@zhangzujian zhangzujian merged commit 3dd7f4a into kubeovn:master Jul 10, 2023
57 of 58 checks passed
@zhangzujian zhangzujian deleted the libovsdb branch July 10, 2023 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Anything that can make Kube-OVN faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

使用 ovnClient(libovsdb 重写)替换 LegacyClient 函数调用
2 participants